﻿@model IEnumerable<BB.Apostas.Models.Classificacao>
<script src="../../Code/Classificacao.js" type="text/javascript"></script>
<h2>Classificacao</h2>
@if (Model != null)
{
    <h4>Competicao Activa: <strong>@ViewBag.Active</strong>
    </h4>
    if (ViewBag.Jornadas != null)
    {
    <div class="login_settings">
        <p>
            <label>
                Jornada:</label>
            @Html.DropDownList("Jornadas", "<< Seleccione uma jornada >>")
        </p>
    </div>
    }  
    <table id="tblRank" class="sofT">    
        <tr>
            <td class="helpHed">Posicao
            </td>
            <td class="helpHed">Nome
            </td>
            <td class="helpHed">Vitorias
            </td>
            <td class="helpHed">Empates
            </td>
            <td class="helpHed">Derrotas
            </td>
            <td class="helpHed">Golos Marcados
            </td>
            <td class="helpHed">Golos Sofridos
            </td>
            <td class="helpHed">Pontos
            </td>
        </tr>
        @{           
    int i = 0;
    foreach (var item in Model)
    {
            <tr>
                <td class="sup">
                    @(i + 1)
                </td>
                <td class="helpBod">
                    @Html.DisplayFor(modelitem => item.User.UserName)
                </td>
                <td class="helpBod">
                    @Html.DisplayFor(modelitem => item.W)
                </td>
                <td class="helpBod">
                    @Html.DisplayFor(modelitem => item.D)
                </td>
                <td class="helpBod">
                    @Html.DisplayFor(modelitem => item.L)
                </td>
                <td class="helpBod">
                    @Html.DisplayFor(modelitem => item.GF)
                </td>
                <td class="helpBod">
                    @Html.DisplayFor(modelitem => item.GA)
                </td>
                <td class="helpBod" style="font-weight:bold">
                    @Html.DisplayFor(modelitem => item.Score)
                </td>
            </tr>
        i++;
    }            
        }
    </table>
}
else
{
    <h3>Nao ha competicoes activas.
    </h3>
}